home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2006 May / PCpro_2006_05.ISO / files / mobile / fma-2.0-stable-setup.exe / {app} / sframework / plugins / MediaPlayerClassic.vbs < prev    next >
Encoding:
Text File  |  2004-09-10  |  3.1 KB  |  129 lines

  1. 'FMA Script Framework Plugin
  2. 'BSPlayer
  3. 'Lets you control BSPlayer
  4.  
  5. 'TODO:
  6. '-Testing
  7.  
  8. Class MediaPlayerClassic
  9.     
  10.     Private llist
  11.     Private m_Self
  12.     Private m_BSPlayerZoom
  13.     Private mainMenu
  14.     
  15.     'Some info about the plugin
  16.     Public Property Get SHOWABLE 'Do I have a menu?
  17.         SHOWABLE    = True
  18.     End Property
  19.     Public Property Get TITLE 'What's my name?
  20.         TITLE       = "Media Player Classic"
  21.     End Property
  22.     Public Property Get DESCRIPTION 'What's my purpose?
  23.         DESCRIPTION = "Lets you control Media Player Classic"
  24.     End Property
  25.     Public Property Get AUTHOR 'Who created me?
  26.         AUTHOR      = "wertherman (based on bsplayer code by streawkceur)"
  27.     End Property
  28.     Public Property Get URL 'Were can I be found? Where can you get more information?
  29.         URL = "http://fma.sourceforge.net/"
  30.     End Property
  31.     
  32.     'Who am I?
  33.     Public Property Let Self (s)
  34.         m_Self = s
  35.         ' Some init stuff here:
  36.         If IsEmpty(Settings(Me, "Title")) or Settings(Me, "Title") = "" Then Settings(Me, "Title") = "Media Player Classic"
  37.         If IsEmpty(Settings(Me, "Exe"))   or Settings(Me, "Exe")   = "" Then Settings(Me, "Exe")   = "C:\Program Files\Media Player Classic\mplayerc.exe"
  38.         Set mainMenu = New ManagedMenu
  39.     End Property
  40.  
  41.     Public Property Get Self
  42.         Self = m_Self
  43.     End Property
  44.     
  45.     'Display me. Eventually put a menu on the screen
  46.     Sub Show()
  47.         '--> Init Menu
  48.         Set llist = New LinkedList
  49.         Dim bi
  50.         bi = llist.BackInserter
  51.         If MpcOpen Then
  52.             bi.Item = Array("Play/Pause",    Self & ".PlayPause")
  53.             bi.Item = Array("Stop",          Self & ".Stopp")
  54.             bi.Item = Array("Subtitles",     Self & ".SubTitles")
  55.             bi.Item = Array("Audio",     Self & ".SwitchAudio")
  56.             bi.Item = Array("Fullscreen",    Self & ".Fullscreen")
  57.             bi.Item = Array("Volume Up",     Self & ".VolumeUp")
  58.             bi.Item = Array("Volume Down",     Self & ".VolumeDown")
  59.             bi.Item = Array("Close",         Self & ".Close")
  60.         Else
  61.             bi.Item = Array("Launch",        Self & ".Launch")
  62.         End If
  63.         mainMenu.SetList llist
  64.         
  65.         mainMenu.Title = TITLE
  66.         mainMenu.ShowMenu
  67.     End Sub
  68.     
  69.     Function MpcOpen
  70.         MpcOpen = Shell.AppActivate(Settings(Me, "Title"))
  71.     End Function
  72.     
  73.     Sub Launch
  74.         If Fso.FileExists(Settings(Me, "Exe")) Then
  75.             Shell.Exec Settings(Me, "Exe")
  76.             Util.WaitForAppLoad Settings(Me, "Title"), 10000 'Give Mpc max. 10 secs to load
  77.         Else
  78.             Debug.ErrorMsg Self & " - Launch: File not found: " & Settings(Me, "Exe")
  79.         End If
  80.         Show
  81.     End Sub
  82.     
  83.     Sub Close
  84.         If MpcOpen Then
  85.             Shell.SendKeys "%{F4}"
  86.             Util.Sleep 5000 'Give Mpc 3secs to close itself
  87.         End If
  88.         Show
  89.     End Sub
  90.     
  91.     Sub PlayPause
  92.         If MpcOpen Then Shell.SendKeys " "
  93.         am.Update
  94.     End Sub    
  95.  
  96.     Sub VolumeUp
  97.         If MpcOpen Then Shell.SendKeys "{UP}"
  98.         am.Update
  99.     End Sub    
  100.     
  101.     Sub VolumeDown
  102.         If MpcOpen Then Shell.SendKeys "{DOWN}"
  103.         am.Update
  104.     End Sub    
  105.  
  106.     
  107.     Sub SwitchAudio
  108.         If MpcOpen Then Shell.SendKeys "A"
  109.         am.Update
  110.     End Sub    
  111.     
  112.     Sub Stopp
  113.         If MpcOpen Then Shell.SendKeys "."
  114.         am.Update
  115.     End Sub
  116.     
  117.     
  118.     Sub SubTitles
  119.         If MpcOpen Then Shell.SendKeys "S"
  120.         am.Update
  121.     End Sub
  122.     
  123.     Sub Fullscreen
  124.         If MpcOpen Then Shell.SendKeys "%{ENTER}"
  125.         am.Update
  126.     End Sub
  127. End Class
  128.  
  129.